﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using HotelSoft.HotelManagement_DTO;

namespace HotelSoft.HotelManagement_DAO
{
    class mainTiepTanDAO:AbstractDAO
    {
        public override bool Them(object AbstractDTO)
        {
            return true;
        }

        public override bool CapNhatThongTin(object AbstractDTO)
        {
            return true;
        }

        public override void TraCuu(object AbstractDTO)
        {

        }

        public override void Xoa(object AbBstractDTO)
        {

        }

        public DataTable getSoPDK(object AbstractDTO)
        {
            PhongDTO dto = (PhongDTO)AbstractDTO;
            string sql = "Select top 1 pdk.SoPDK, p.TrangThai, Songaythue, ngayden, SoNguoi from PHONG p, PHIEUDANGKY pdk where p.SoPhong=pdk.SoPhong and p.TrangThai=N'Đang thuê' and p.SoPhong='"+dto.SOPHONG+"' Order by Ngayden desc";
            return Config.AccessHelper.ExecuteQuery(sql);
        }
    }
}
